<template>
  <el-dialog title="账单详情" :visible.sync="dialogVisible" :close-on-click-modal="false" width="850px">
    <div class="">
      <el-descriptions :labelStyle="{
            width:'100px'

          }" :title="formData.createTime" labelClassName="label-txt" border :column='3'>
              <el-descriptions-item label="收支类型">
                <span v-if="formData.type==1">收入</span>
                <span v-if="formData.type==2">支出</span>
              </el-descriptions-item>
              <el-descriptions-item label="账单类型" :span="2">{{ formData.bookType }}</el-descriptions-item>
              <el-descriptions-item label="对方名称">{{ formData.duifangmingcheng }}</el-descriptions-item>
              <el-descriptions-item label="对方账户" :span="2">{{formData.duifangzhanghu  }}</el-descriptions-item>
              <el-descriptions-item label="本方名称" >{{formData.benfangmingcheng  }}</el-descriptions-item>
              <el-descriptions-item label="本方账户" :span="3">{{formData.benfangzhanghu  }}</el-descriptions-item>
              <el-descriptions-item label="金额" :span="3">
                <span style="color: red;">¥</span>
                <span style="color: red;font-size: 18px;">{{formData.jine  }}</span>
              </el-descriptions-item>
              <el-descriptions-item label="明细" :span="3">{{formData.mingxi  }}</el-descriptions-item>
              <el-descriptions-item label="备注" :span="3">{{formData.beizhu  }}</el-descriptions-item>
              <el-descriptions-item label="图片" :span="3">
                <div v-if="imgList&&imgList.length">
                  <el-image style="width:80px;height:80px; margin-right:10px;margin-bottom:10px" :preview-src-list="imgList" preview v-for="(img,i) in imgList" :key="i" :src="img"></el-image>

                </div>
            </el-descriptions-item>
            <el-descriptions-item label="创建人" >{{formData.createName  }}</el-descriptions-item>
            <el-descriptions-item label="经办人" >{{formData.jingbanren  }}</el-descriptions-item>
            <el-descriptions-item label="复核人" >{{formData.fuheren  }}</el-descriptions-item>
          </el-descriptions>
    </div>
  </el-dialog>
</template>

<script>
export default {
  name: "",
  data() {
    return {
      dialogVisible: false,
      loading: false,
      formData:'',
      imgList:[]
    };
  },
  methods: {
    // 打开弹窗
    open(data) {
      this.dialogVisible = true;
      this.formData = data
      this.imgList = []
      if(this.formData.img){
        const arr = JSON.parse(this.formData.img)
        if(arr&&arr.length){
          arr.forEach(r=>{
            this.imgList.push(r.url)
          })
        }
      }
    },
   
    close() {
      this.dialogVisible = false;
    }
  }
};
</script>
<style scoped lang="css">
.center {
  text-align: center;
}

</style>
